﻿CREATE TABLE [dbo].[CheckInOut] (
    [id]              INT             IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL,
    [CustomerId]      NVARCHAR (50)   NULL,
    [ContactPerson]   NVARCHAR (50)   NULL,
    [ContactTel]      NVARCHAR (50)   NULL,
    [Address]         NVARCHAR (500)  NULL,
    [MainProjectId]   INT             NULL,
    [Aim]             NVARCHAR (50)   NULL,
    [Content]         NVARCHAR (500)  NULL,
    [Accompany]       NVARCHAR (50)   NULL,
    [ResultFlag]      INT             CONSTRAINT [DF_CheckInOut_ResultFlag] DEFAULT ((0)) NULL,
    [ResultText]      NVARCHAR (200)  NULL,
    [UserName]        NVARCHAR (50)   NULL,
    [CheckInTime]     DATETIME        NULL,
    [CheckOutTime]    DATETIME        NULL,
    [CompanyId]       INT             NULL,
    [DepartmentId]    INT             CONSTRAINT [DF_CheckInOut_DepartmentId] DEFAULT ((0)) NULL,
    [PositionTime]    DATETIME        CONSTRAINT [DF_CheckInOut_PositionTime] DEFAULT (((1900)-(1))-(1)) NULL,
    [Longitude]       DECIMAL (18, 8) CONSTRAINT [DF_CheckInOut_Longitude] DEFAULT ((0)) NULL,
    [Latitude]        DECIMAL (18, 8) CONSTRAINT [DF_CheckInOut_Latitude] DEFAULT ((0)) NULL,
    [PositionAddress] NVARCHAR (500)  NULL,
    CONSTRAINT [PK_CheckInOut] PRIMARY KEY CLUSTERED ([id] ASC)
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'定位时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CheckInOut', @level2type = N'COLUMN', @level2name = N'PositionTime';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'经度', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CheckInOut', @level2type = N'COLUMN', @level2name = N'Longitude';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'纬度', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CheckInOut', @level2type = N'COLUMN', @level2name = N'Latitude';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'定位地址', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CheckInOut', @level2type = N'COLUMN', @level2name = N'PositionAddress';

